Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Masthead): Update structure #730

Merged

Conversation

wise-king-sullyman
Copy link
Collaborator

Closes #718

@wise-king-sullyman wise-king-sullyman marked this pull request as ready for review August 2, 2024 19:24
@wise-king-sullyman
Copy link
Collaborator Author

This isn't in a merge-ready state (I'll have to make some final updates after #729 lands) but it should be ready now for some preliminary reviews.

Copy link
Contributor

@adamviktora adamviktora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great 🏆. One comment bellow regarding simplifying / removing the stringifyJSXElement helper.

}

/** Gets a string representation of an element including */
export function stringifyJSXElement(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, but I think you can do just return context.getSourceCode().getText(node)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Comment on lines 5 to 12
valid: [
{
code: `<Masthead />`,
},
{
code: `import { Masthead } from '@patternfly/react-core'; <Masthead someOtherProp />`,
},
],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The valid tests should probably be updated. One would be the code from one of the invalid tests (without the import statement), and the other could be the output from one of the invalid tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops

output: `import { Masthead, MastheadBrand, MastheadMain, MastheadToggle } from '@patternfly/react-core'; <Masthead><MastheadMain><MastheadToggle>Foo</MastheadToggle><MastheadBrand>Bar</MastheadBrand></MastheadMain></Masthead>`,
errors: [
{
message: `The structure of Masthead has been updated, MastheadToggle and MastheadBrand should now be wrapped in MastheadMain.`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit not a blocker: wdyt about updating the message that gets output to only mention the applicable element? Instead of saying both "toggle and brand...", on a MastheadToggle, only mention "toggle...".

},
],
},
// stage one of a post-renamed file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit not a blocker: for these comments for the pre/post renamed file, maybe instead "Stage [one|two] of a file that [has been|has NOT been] fixed by masthead-name-changes rule"

@adamviktora adamviktora merged commit 827500c into patternfly:main Aug 14, 2024
3 checks passed
@wise-king-sullyman wise-king-sullyman deleted the masthead-structure-changes branch August 14, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Masthead -Updates for Mastheads new structure
3 participants